import storage from 'good-storage'

// token
const TOKEN = '__TOKEN__'

// 账号密码
const REM_PASSWORD = '__REM_PASSWORD__'

// 用户信息
const USERINFO = '__USERINFO__'

export function getToken() {
    return storage.get(TOKEN, '')
}

export function setToken (token) {
    storage.set(TOKEN, token)
}

export function getRemPassword () {
   return storage.get(REM_PASSWORD, [])
}

export function setRemPassword (username, password) {
    storage.set(REM_PASSWORD, [username, password])
}

export function setUserInfo (userInfo) {
    storage.set(USERINFO, userInfo)
}

export function getUserInfo () {
    return storage.get(USERINFO, {})
}
